version: '3.5'
services:
    rhinoceros:
        build:
            context: ./docker/web
            # dockerfile: prod/Dockerfile
            args:
                HOST_UID: ${HOST_UID}
        hostname: "rhinoceros"
        container_name: "rhinoceros"
        volumes:
            - .:/var/www/html
            - ./docker/web/apache_${APP_ENV}.conf:/etc/apache2/sites-available/000-default.conf:ro
            - ${UPLOADS_PATH}:/var/www/resources
        tmpfs:
            - /tmp
            - /var/www/html/var/cache:uid=${HOST_UID},gid=${HOST_UID}
        ports:
            - "8033:80"
        links:
            - mailcatcher
        depends_on:
            - mailcatcher
        environment:
            APPLICATION_ENV: development
            CIRCLE_ARTIFACTS: /var/www/html/var/tests
            VARNISH_BAN_TOKEN: ${VARNISH_BAN_TOKEN}
        extra_hosts:
            - "database.lan:${DATABASE_IP}"
            - "reprogl.xelbot.com:${APPLICATION_IP}"
        networks:
            - blognet

    lizard:
        build:
            context: ${OLD_BLOG_PATH}/var/docker/web
            # dockerfile: prod/Dockerfile
            args:
                HOST_UID: ${HOST_UID}
        container_name: "lizard"
        volumes:
            - ${OLD_BLOG_PATH}:/var/www/html
        links:
            - mailcatcher
        depends_on:
            - mailcatcher
        environment:
            APPLICATION_ENV: development
        extra_hosts:
            - "database.lan:${DATABASE_IP}"
            - "zendblog.xelbot.com:${APPLICATION_IP}"
        networks:
            - blognet

    mailcatcher:
        image: xelbot/mailcatcher
        ports:
            - "1080:1080"
        networks:
            - blognet

    nodejs:
        image: xelbot/docker-zendblog-nodejs
        volumes:
            - .:/var/www/html
        networks:
            - blognet

    sloth:
        build: ./docker/nginx
        volumes:
            - .:/var/www/html
            - ${OLD_BLOG_PATH}:/var/www/old_resources
            - ${GOLANG_BLOG_PATH}:/var/www/app
        ports:
            - "443:443"
            - "80:80"
        depends_on:
            - rhinoceros
            - lizard
        links:
            - rhinoceros
            - lizard
        networks:
            - blognet

networks:
    blognet:
        external: true
